using Godot;
using System;

public partial class ActorBeActtacted : BehaviorBase
{
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}

	public override BehaviorResult tick(Node _actor, Node _blackBoard)
	{
		var node = (Enemy)_actor;
		switch (nodeNo)
		{
			case 1:
				if (node.CheckBeAttack1())
				{
					node.BeAttack(1);
					//GD.Print("wo bei da le");
					return BehaviorResult.SUCCESS;
				}
				return BehaviorResult.FAILURE;
			case 2:
				if (node.CheckBeAttack2())
				{
					node.BeAttack(2);
					//GD.Print("wo bei da le 2");
					return BehaviorResult.SUCCESS;
				}
				return BehaviorResult.FAILURE;
			default:
				return BehaviorResult.FAILURE;
		}

	}
}
